function [output] = fn_CF(delta,R1,D0i,y,alphaF)
% Output: consumption in failure states
% Input: y is given as a share

output = min(D0i*R1,delta) + alphaF*max(D0i*R1-delta,0) + y*D0i;

end